﻿using HenuAlbum.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace HenuAlbum.ControllerModels
{
    public class PersonalResourceResult
    {
        public Guid Id { get; set; }
        public Album Album { get; set; }
        public string Title { get; set; }
        public string Description { get; set; }
        public DateTime CreateTime { get; set; }
        public string Type { get; set; }
        public List<ResourceTag> Tags { get; set; }
        public PersonalResourceResult(Guid id, Album album,
                                      string title, string description, 
                                      DateTime createTime,ResourceType type, 
                                      List<ResourceTag> tags)
        {
            this.Id = id;
            Album = album;
            Title = title;
            Description = description;
            CreateTime = createTime;
            Type = type switch
            {
                ResourceType.Picture => "pic",
                ResourceType.Video => "video",
                ResourceType.Document => "doc",
                _ => throw new NotImplementedException()
            };
            Tags = tags;
        }
    }
}
